package week1.blog_code.exer1001;

import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        // 1. 状态定义：dp[i]表示2行i列的铺法数
        BigInteger[] dp = new BigInteger[n + 1];
        // 2. 状态初始化
        dp[1] = new BigInteger("1");
        dp[2] = new BigInteger("3");
        // 3. 状态转移方程
        for (int i = 3; i <= n; i++) {
            dp[i] = dp[i - 1].add(dp[i - 2].multiply(new BigInteger("2")));
        }
        // 4. 返回值
        System.out.println(dp[n]);
    }
}
